//@author A0081058H
package net.mysoc.w111j.ui.expensedetail;

import java.util.List;

import javafx.beans.property.IntegerProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import net.mysoc.w111j.model.Category;
import net.mysoc.w111j.model.PaymentType;

/**
 * The model for the expense detail window.
 */
public class ExpenseDetailModel {
    private final IntegerProperty id;
    private final StringProperty name;
    private final StringProperty price;
    private final StringProperty date;
    private final ObservableList<Category> categories;
    private final ObjectProperty<Category> category;
    private final StringProperty details;
    private final ObservableList<PaymentType> paymentTypes;
    private final ObjectProperty<PaymentType> paymentType;

    public ExpenseDetailModel() {
        this.id = new SimpleIntegerProperty();
        this.name = new SimpleStringProperty();
        this.price = new SimpleStringProperty();
        this.date = new SimpleStringProperty();
        this.categories = FXCollections.observableArrayList();
        this.category = new SimpleObjectProperty<>();
        this.paymentTypes = FXCollections.observableArrayList();
        this.paymentType = new SimpleObjectProperty<>();
        this.details = new SimpleStringProperty();
    }

    public StringProperty nameProperty() {
        return this.name;
    }

    public int getId() {
        return this.id.get();
    }

    public void setId(int id) {
        this.id.set(id);
    }

    public String getName() {
        return this.name.get();
    }

    public void setName(String name) {
        this.name.set(name);
    }

    public StringProperty priceProperty() {
        return this.price;
    }

    public String getPrice() {
        return this.price.get();
    }

    public void setPrice(String price) {
        this.price.set(price);
    }

    public StringProperty dateProperty() {
        return this.date;
    }

    public String getDate() {
        return this.date.get();
    }

    public void setDate(String date) {
        this.date.set(date);
    }

    public ObjectProperty<Category> categoryProperty() {
        return this.category;
    }

    public Category getCategory() {
        return this.category.get();
    }

    public void setCategory(Category category) {
        this.category.set(category);
    }

    public ObservableList<Category> categoriesListProperty() {
        return this.categories;
    }

    public void setCategories(List<Category> categories) {
        this.categories.setAll(categories);
    }

    public StringProperty detailsProperty() {
        return this.details;
    }

    public String getDetails() {
        return this.details.get();
    }

    public void setDetails(String details) {
        this.details.set(details);
    }

    public ObjectProperty<PaymentType> paymentTypeProperty() {
        return this.paymentType;
    }

    public PaymentType getPaymentType() {
        return this.paymentType.get();
    }

    public void setPaymentType(PaymentType paymentType) {
        this.paymentType.set(paymentType);
    }

    public ObservableList<PaymentType> paymentTypesListProperty() {
        return this.paymentTypes;
    }

    public void setPaymentTypes(List<PaymentType> paymentTypes) {
        this.paymentTypes.setAll(paymentTypes);
    }
}
